-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate device factory into a creator layer #970
base: main
Are you sure you want to change the base?
Conversation
…ive connection costs can be incurred once, for device types such as cloud storage. Process now is: (1) Instantiate a factory creator (2) Ask creator for a factory, given a base path (2) Ask factory for devices
Note: It seems that the AzureStreamProvider currently creates its own "factory creator" using the provided connection string (even before GarnetServerOptions are created), so it is possible we instantiate the connection twice in case user were importing/exporting the config file from Azure. Ideally we would pass in a shared azure storage factory creator to the stream provider and use the same for GarnetServerOptions. But this seems to be a rare case, so did not optimize for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -277,9 +277,9 @@ public class GarnetServerOptions : ServerOptions | |||
public int NetworkConnectionLimit = -1; | |||
|
|||
/// <summary> | |||
/// Creator of device factories | |||
/// Func to help create device factories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: looks like the comment wasn't updated properly?
readonly bool readOnly; | ||
readonly ILogger logger; | ||
|
||
public LocalStorageNamedDeviceFactoryCreator(bool preallocateFile = false, bool deleteOnClose = false, bool disableFileBuffering = true, int? throttleLimit = null, bool useNativeDeviceLinux = false, bool readOnly = false, ILogger logger = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have an XML comment that describes each parameter
Separate device factory into a creator layer so that expensive connection costs can be incurred once, for device types such as cloud storage. Workflow now is:
(1) Instantiate a factory creator
(2) Ask creator for a factory, given a base path
(2) Ask factory for devices instances
Fixes #739.